package com.yc.boottxx.controller;

import com.yc.boottxx.vo.Demo;
import javax.annotation.Resource;
import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * Company 源辰信息
 *
 * @author navy
 * @date 2024/5/27
 * Email haijunzhou@hnit.edu.cn
 */
@RestController
@Data
public class HelloAction {

    @RequestMapping("hello")
    String hello(){
        return "hello spring boot";
    }

    @Resource
    Demo demo;

    @GetMapping("showDemo")
    Demo showDemo(){
        return demo;
    }

    @Value("张三")
    String name;

    @Value("${demo.name}")
    String name1;

    @Value("${demo.age}")
    int age;

    @Value("${demo.type:学生}")
    String type;

//    @Value("${demo.familys}")
//    Map<String,Object> familys;

    @GetMapping("showValue")
    Object showValue(){
        return this;
    }

}


